@import './behavior';
@import './color';

$markdown-list-color: #262626;
$markdown-primary: #384452;
$markdown-grey: #d1d8df;
$markdown-green: #1abc9c;
$markdown-dark-grey: #5e6772;
$markdown-blue: #23B7F3;
$markdown-code-grey: #eef1f5;
$markdown-color-red: #f53d3d;
$markdown-color-yellow: #ffff3a;
$markdown-light-grey: #fdfdfd;
$markdown-mid-grey: #666;
$line-height: 1.5em;

.markdown {
  .row {
    display: flex;
    flex-direction: column;
    padding: 0;
    width: 100%
  }

  .row.row-no-padding {
    padding: 0
  }

  .row.row-no-padding > .column {
    padding: 0
  }

  .row.row-wrap {
    flex-wrap: wrap
  }

  .row.row-top {
    align-items: flex-start
  }

  .row.row-bottom {
    align-items: flex-end
  }

  .row.row-center {
    align-items: center
  }

  .row.row-stretch {
    align-items: stretch
  }

  .row.row-baseline {
    align-items: baseline
  }

  .row .column {
    display: block;
    flex: 1 1 auto;
    margin-left: 0;
    max-width: 100%;
    width: 100%
  }

  .row .column.column-offset-10 {
    margin-left: 10%
  }

  .row .column.column-offset-20 {
    margin-left: 20%
  }

  .row .column.column-offset-25 {
    margin-left: 25%
  }

  .row .column.column-offset-33, .row .column.column-offset-34 {
    margin-left: 33.3333%
  }

  .row .column.column-offset-50 {
    margin-left: 50%
  }

  .row .column.column-offset-66, .row .column.column-offset-67 {
    margin-left: 66.6666%
  }

  .row .column.column-offset-75 {
    margin-left: 75%
  }

  .row .column.column-offset-80 {
    margin-left: 80%
  }

  .row .column.column-offset-90 {
    margin-left: 90%
  }

  .row .column.column-10 {
    flex: 0 0 10%;
    max-width: 10%
  }

  .row .column.column-20 {
    flex: 0 0 20%;
    max-width: 20%
  }

  .row .column.column-25 {
    flex: 0 0 25%;
    max-width: 25%
  }

  .row .column.column-33, .row .column.column-34 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%
  }

  .row .column.column-40 {
    flex: 0 0 40%;
    max-width: 40%
  }

  .row .column.column-50 {
    flex: 0 0 50%;
    max-width: 50%
  }

  .row .column.column-60 {
    flex: 0 0 60%;
    max-width: 60%
  }

  .row .column.column-66, .row .column.column-67 {
    flex: 0 0 66.6666%;
    max-width: 66.6666%
  }

  .row .column.column-75 {
    flex: 0 0 75%;
    max-width: 75%
  }

  .row .column.column-80 {
    flex: 0 0 80%;
    max-width: 80%
  }

  .row .column.column-90 {
    flex: 0 0 90%;
    max-width: 90%
  }

  .row .column .column-top {
    align-self: flex-start
  }

  .row .column .column-bottom {
    align-self: flex-end
  }

  .row .column .column-center {
    -ms-grid-row-align: center;
    align-self: center
  }

  @media (min-width: 40rem) {
    .row {
      flex-direction: row;
      margin-left: -1.0rem;
      width: calc(100% + 2.0rem)
    }
    .row .column {
      margin-bottom: inherit;
      padding: 0 1.0rem
    }
  }

  blockquote {
    border-left: 0.3rem solid $markdown-green;
    margin-left: 0;
    margin-right: 0;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  blockquote *:last-child {
    margin-bottom: 0
  }

  q:before {
    color: $markdown-green;
    content: open-quote;
    font-size: 4em;
    line-height: 0.1em;
    margin-right: 0.25em;
    vertical-align: -0.4em
  }

  q:after {
    content: none
  }

  .button, button, input[type='button'], input[type='reset'], input[type='submit'] {
    background-color: $markdown-primary;
    border: 0.1rem solid $markdown-primary;
    border-radius: .4rem;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    height: 3.8rem;
    letter-spacing: .1rem;
    line-height: 3.8rem;
    padding: 0 3.0rem;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap
  }

  .button:focus, .button:hover, button:focus, button:hover, input[type='button']:focus, input[type='button']:hover, input[type='reset']:focus, input[type='reset']:hover, input[type='submit']:focus, input[type='submit']:hover {
    background-color: $markdown-green;
    border-color: $markdown-green;
    color: #fff;
    outline: 0
  }

  .button[disabled], button[disabled], input[type='button'][disabled], input[type='reset'][disabled], input[type='submit'][disabled] {
    cursor: default;
    opacity: .5
  }

  .button[disabled]:focus, .button[disabled]:hover, button[disabled]:focus, button[disabled]:hover, input[type='button'][disabled]:focus, input[type='button'][disabled]:hover, input[type='reset'][disabled]:focus, input[type='reset'][disabled]:hover, input[type='submit'][disabled]:focus, input[type='submit'][disabled]:hover {
    background-color: $markdown-primary;
    border-color: $markdown-primary
  }

  .button.button-outline, button.button-outline, input[type='button'].button-outline, input[type='reset'].button-outline, input[type='submit'].button-outline {
    background-color: transparent;
    color: $markdown-primary
  }

  .button.button-outline:focus, .button.button-outline:hover, button.button-outline:focus, button.button-outline:hover, input[type='button'].button-outline:focus, input[type='button'].button-outline:hover, input[type='reset'].button-outline:focus, input[type='reset'].button-outline:hover, input[type='submit'].button-outline:focus, input[type='submit'].button-outline:hover {
    background-color: transparent;
    border-color: $markdown-green;
    color: $markdown-green
  }

  .button.button-outline[disabled]:focus, .button.button-outline[disabled]:hover, button.button-outline[disabled]:focus, button.button-outline[disabled]:hover, input[type='button'].button-outline[disabled]:focus, input[type='button'].button-outline[disabled]:hover, input[type='reset'].button-outline[disabled]:focus, input[type='reset'].button-outline[disabled]:hover, input[type='submit'].button-outline[disabled]:focus, input[type='submit'].button-outline[disabled]:hover {
    border-color: inherit;
    color: $markdown-primary
  }

  .button.button-clear, button.button-clear, input[type='button'].button-clear, input[type='reset'].button-clear, input[type='submit'].button-clear {
    background-color: transparent;
    border-color: transparent;
    color: $markdown-primary
  }

  .button.button-clear:focus, .button.button-clear:hover, button.button-clear:focus, button.button-clear:hover, input[type='button'].button-clear:focus, input[type='button'].button-clear:hover, input[type='reset'].button-clear:focus, input[type='reset'].button-clear:hover, input[type='submit'].button-clear:focus, input[type='submit'].button-clear:hover {
    background-color: transparent;
    border-color: transparent;
    color: $markdown-green
  }

  .button.button-clear[disabled]:focus, .button.button-clear[disabled]:hover, button.button-clear[disabled]:focus, button.button-clear[disabled]:hover, input[type='button'].button-clear[disabled]:focus, input[type='button'].button-clear[disabled]:hover, input[type='reset'].button-clear[disabled]:focus, input[type='reset'].button-clear[disabled]:hover, input[type='submit'].button-clear[disabled]:focus, input[type='submit'].button-clear[disabled]:hover {
    color: $markdown-primary
  }

  code {
    background: $markdown-code-grey;
    border-radius: .4rem;
    font-size: 86%;
    margin: 0 .2rem;
    padding: .2rem .5rem;
    white-space: nowrap
  }

  pre {
    background: $markdown-code-grey;
    border-left: 0.3rem solid $markdown-green;
    overflow-y: hidden
  }

  pre > code {
    border-radius: 0;
    display: block;
    padding: 1rem 1.5rem;
    white-space: pre
  }

  hr {
    border: 0;
    border-top: 0.1rem solid $markdown-primary;
    margin: 3.0rem 0
  }

  input[type='email'], input[type='number'], input[type='password'], input[type='search'], input[type='tel'], input[type='text'], input[type='url'], input:not([type]), textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    border: 0.1rem solid $markdown-grey;
    border-radius: .4rem;
    box-shadow: none;
    box-sizing: inherit;
    height: 3.8rem;
    padding: .6rem 1.0rem;
    width: 100%
  }

  input[type='email']:focus, input[type='number']:focus, input[type='password']:focus, input[type='search']:focus, input[type='tel']:focus, input[type='text']:focus, input[type='url']:focus, input:not([type]):focus, textarea:focus, select:focus {
    border-color: $markdown-green;
    outline: 0
  }

  select {
    background: url('data:image/svg+xml;utf8,<svg width="28" height="15" viewBox="0 0 28 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><polygon fill="%235e6772" id="Shape" points="14.3216327 0 7.99510204 5.87878267 1.67836735 0.00773727648 0 1.56757221 7.99510204 9 16 1.55983494"></polygon></svg>') center right no-repeat;
    padding-right: 3.0rem
  }

  select:focus {
    background-image: url('data:image/svg+xml;utf8,<svg width="28" height="15" viewBox="0 0 28 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><polygon fill="%231abc9c" id="Shape" points="14.3216327 0 7.99510204 5.87878267 1.67836735 0.00773727648 0 1.56757221 7.99510204 9 16 1.55983494"></polygon></svg>')
  }

  textarea {
    min-height: 6.5rem
  }

  label, legend {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: .5rem
  }

  fieldset {
    border-width: 0;
    padding: 0
  }

  input[type='checkbox'], input[type='radio'] {
    display: inline
  }

  .label-inline {
    display: inline-block;
    font-weight: normal;
    margin-left: .5rem
  }

  img {
    max-width: 100%;
    display: block;
    margin: 1em auto;
  }

  figcaption {
    text-align: center;
    padding: 8px;
    color: $markdown-mid-grey;
  }

  a {
    color: $markdown-green;
    text-decoration: none
  }

  a:focus, a:hover {
    color: $markdown-blue
  }

  dl, ol, ul {
    list-style: none;
    margin-top: 0;
    padding-left: 0
  }

  dl dl, dl ol, dl ul, ol dl, ol ol, ol ul, ul dl, ul ol, ul ul {
    font-size: 90%;
    margin: 1.0rem 0 1.5rem 1.0rem
  }

  ol {
    list-style: decimal inside
  }

  ul {
    list-style: disc
  }

  li {
    font-size: 1rem;
    color: $markdown-primary
  }

  .button, button, dd, dt, li {
    margin-bottom: 1.0rem
  }

  fieldset, input, select, textarea {
    margin-bottom: 1.5rem
  }

  blockquote, dl, figure, form, ol, p, pre, table, ul {
    margin-bottom: 1.5rem
  }

  table {
    border-spacing: 0;
    width: 100%
  }

  table thead th, thead th {
    border-top: 0.1rem solid $markdown-grey;
    background: $markdown-light-grey
  }

  table td {
    min-width: 7rem;
  }

  tbody tr:nth-child(even) {
    background: $markdown-light-grey
  }

  tbody tr:nth-child(odd) {
    background: $markdown-code-grey
  }

  td, th {
    border-bottom: 0.1rem solid $markdown-grey;
    padding: 1.2rem 1.5rem;
    text-align: left;
  }

  u {
    text-decoration: none;
    border-bottom: 1px dashed
  }

  a {
    text-decoration: none
  }

  u {
    background: $markdown-color-yellow
  }

  b, strong {
    font-weight: bold
  }

  p {
    font-weight: 200;
    padding: 0.5em;
  }

  h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    margin-top: 2.0rem;
    margin-bottom: 1rem;
    line-height: 1.5;
  }

  h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-top: 4rem;
    margin-bottom: 2rem;
  }

  h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-top: 3rem;
    border-bottom: 1px double rgba(0,0,0,.1);
  }

  h3 {
    font-size: 1.5rem;
    font-weight: 400;
  }

  h4 {
    font-size: 1.3rem;
  }

  h5 {
    font-size: 1.2rem;
  }

  h6 {
    font-size: 1.1rem;
    letter-spacing: 0;
  }

  p {
    font-size: 1.0rem;
    letter-spacing: 0.05em;
  }

  pre[class*="language-"] {
    margin: 1em 0;
  }

  p {
    line-height: $line-height;
    margin-bottom: 0;
  }

  ul, ol {
    margin-top: 0.8em;
    font-weight: 300;

    li {
      color: $markdown-list-color;
      line-height: $line-height;
    }
  }

  table {
    margin-top: 1em;
  }

  td {
    padding: 1rem 1rem;
  }

  pre {
    margin: 1em 0 !important;
    padding: 0 4px !important;

    code {
      padding: 16px 0;
      font-size: 0.9em;
      line-height: 1.5;
    }
  }
}



